const EventBus = require('vertx3-eventbus-client');
export default {
  open(onOpen) {
    let addr = 'http://' + window.location.hostname + ':' + process.env.VUE_APP_EVENT_BUS + '/eventbus';

    console.log('EVENT_BUS_ADDR=', addr);
    const eb = new EventBus(addr);
    eb.enableReconnect(true);
    eb.onopen = () => {
      onOpen(eb)
    };
    return eb;
  }
}
